%\gray
\chapter{Commutative Algebra}
\section{Rings}
\noindent In these notes a \emph{ring}\index{Rings} refers to a commutative unitary ring, unless mentioned otherwise.
\subsection{Ring Algebras}
\noindent Let $A$ be a ring, $A\hookrightarrow B$ an $A$-algebra, we say that $B$ is an $A$-algebra of finite presentation iff it is isomorphic to a quotient of polynomial ring $A[x_1,..,x_n]$ by a finitely generated ideal of $A[x_1,..,x_n]$.

\subsection{Ideals}
\noindent Extension and contraction\\
primary decomposition 

\subsection{Henselian Rings}
\tcb{Motivation Hensel's lemma}
\black 
\begin{definition}
Let $A$ be a local ring, $\gom$ its maximal ideal, $\kk=A/\gom$ its residue field, we way that $A$ is Henselian if every factorisation of $\overline{f}\in \kk[x]$ into coprimes factors is lifted to a coprime factorisation of $f\in A[x]$, for every $f\in A[x]$, where $\overline{f}$ is the canonical image of $f$ in $\kk[x]$. We denote the Henselian ring with the tuple $(A,\gom,\kk).$
\end{definition}
\tcb{Henselisation of local rings}.
\subsection{Noetherian Rings}
\begin{lemma}
\noindent Let $A$ be a ring, then the following conditions are equivalents:
\begin{itemize}
\item Every ascending chain of ideals of $A$ is stationary
\item Every ideal in $A$ is finitely generated.
\end{itemize}
\end{lemma}
\begin{definition}[Noetherian Rings]\index{ring!Noetherian Rings}
\noindent A ring $A$ is called Noetherian ring if it satisfies any of the above equivalent conditions.
\end{definition}
\noindent \tcb{We are particularly interested in schemes and varieties defined on Noetherian rings, that all such varieties are finite intersection of hypersurfaces.} hence, \\
\noindent \tcb{Noetherian rings have lots of interesting properties}.
\begin{proposition}[Hilbert's basic theorem]
\noindent Let $A$ be a Noetherian ring, then the polynomial ring $A[x]$ is Noetherian.
\end{proposition}
\begin{lemma}
\noindent Let $A$ be a Noetherian ring, $B$ a finitely generated $A$-algebra. Then, $B$ is Noetherian.
\end{lemma}
\begin{lemma}
\noindent Let $A$ be a Noetherian ring, $S$ a multiplicative system of $A$, then the localisation $S^{-1}A$ is Noetherian.
\end{lemma}
\begin{lemma}
\noindent In a Noetherian ring $A$, every irreducible ideal is primary
\end{lemma}
\tcr{Is the inverse true?}
\begin{lemma}
\noindent In a Noetherian ring $A$, every ideal is a finite intersection of irreducible ideals
\end{lemma}
\begin{lemma}
\noindent In a Noetherian ring $A$, every ideal has a primary decomposition
\end{lemma}

%\gray
\subsection{Artin Rings}\index{ring!Artin Rings}
\begin{definition}[Artin Rings]
A ring $A$ is called Artin ring if
\end{definition}
\subsection{Regular Rings}
motivation
\begin{definition}[Krull Dimension]
\end{definition}
link between Krull dimension, and the Krull dimension of its localisation.
\begin{lemma}
Let $(A,\gom,\kk)$ be a local ring, then the minimal number of generator of the maximal ideal $\gom$ is greater than or equal Krull dimension of the ring $A$.
\end{lemma}
\noindent It would be interesting to investigate the local rings where such inequality turns into equality.
\begin{definition}[Regular Local Rings]
Let $(A,\gom,\kk)$ be a Noetherian local ring, we say that $A$ is regular local ring if the minimal number of generator of the maximal ideal $\gom$ equals Krull dimension of the ring $A$.
\end{definition}
\begin{lemma}
Let $(A,\gom,\kk)$ be a Noetherian local ring, $A$ is regular if and only if $$\dim_{\kk}\gom/{\gom^2}=\dim A.$$
\end{lemma}
\begin{definition}[Regular Rings]
Let $A$ be a Noetherian ring, we say that $A$ is regular ring if its localisation at every prime ideal are regular local rings.
\end{definition}
\noindent \tcb{Failure for being regular local ring, when localising at a prime ideal, indicates singularity.}
\begin{example}
Let $A$ be a regular ring, then $R[x]$ is regular.
\end{example}
\begin{example}[Counter Example]
Let $\kk$ be algebraically closed field, then $A=\kk[x,y]/(x.y)$ is not regular, that the its localisation at $(\overline{x},\overline{y})$, has Krull dimension $\dim A=1$, whereas the minimal generators system of its maximal ideal $(\overline{x},\overline{y})A_{(\overline{x},\overline{y})}$ consists of two elements.
\end{example}
\subsection{Discrete Valuation Rings}

\subsection{Dedekind Domains}

\subsection{Completion}

\subsection{Dimension Theory}
%\gray

\section{Modules}
\begin{lemma}
Let $f:R\rightarrow S$ a homomorphism of rings, then $(S,+_S,\triangleright)$ is an $R$ module, where $\triangleright$ is defined by:
$$
\begin{array}{lccc}
\triangleright: &	R\times S	&\rightarrow	&S\\
				&	(r,s)		&\longmapsto	&f(r)\cdot s
\end{array}
$$
\end{lemma}
\begin{proof}
\tcb{type it down}
\end{proof}
\subsection{Projective Modules}
\subsection{Tensor Product}
\subsection{Flat Modules}[Tensor Exact]
\begin{lemma}
Let $M\in R-\Mod$, then the following conditions are equivalents:
\begin{itemize}
\item For every exact sequence $\xymatrix{E'\ar[r]^f & E \ar[r]^g & E''}$ in $R-\Mod$, the sequence\\ $\xymatrix{M\otimes_R E'\ar[r]^{M\otimes_R f} & M\otimes_R E \ar[r]^{M\otimes_R g}& M\otimes_R E''}$ is also exact.
\item For every short exact sequence $\xymatrix{0\ar[r]&E'\ar[r]^f & E \ar[r]^g & E''\ar[r]&0}$ in $R-\Mod$, the sequence $\xymatrix{0\ar[r]&M\otimes_R E'\ar[r]^{M\otimes_R f} & M\otimes_R E \ar[r]^{M\otimes_R g} & M\otimes_R E''\ar[r]&0}$ is also exact.
\item For every exact sequence $\xymatrix{0\ar[r]&E'\ar[r]^f & E}$, i.e. a monomorphism, the sequence $\xymatrix{0\ar[r]& M\otimes_R E'\ar[r]^{M\otimes_R f} & M\otimes_R E}$ is also exact, i.e. a monomorphism.
\end{itemize}
\end{lemma}
\begin{proof}
\tcg{type it}
\end{proof}
\begin{definition}
Let $M\in R-\Mod$,then we call $M$ a flat module over $R$, or tensor exact module, if any of the conditions of the previous lemma holds.
\end{definition}
\begin{example}[Examples of flat modules].
\begin{itemize}
\item $R$ is flat over itself.
\item Let $M=\oplus_{i\in I}M_i$ in $R-\Mod$. Then, $M$ is flat iff $M_i$ is flat $\forall i\in I$. Hence, free modules, over $R$, are flat over $R$.
\item Projective modules in $R-\Mod$, are flat over $R$. Hence, free modules and vector spaces are.
\end{itemize}
\end{example}
\begin{proof}
\tcg{type it}
\end{proof}
\begin{proposition}
Let $f:R\rightarrow M$ be a ring homomorphism, the $M$, as $R$-module induced by $f$ is flat iff $\goa\otimes_R M\rightarrow M$, defined by $a\otimes b\mapsto f(a)b$, is an injection for
\end{proposition}
\begin{proof}
\tcb{ype it, etale cohomology, P 7.}
\end{proof}
\begin{proposition}
\begin{itemize}
\item Let $S$ be a multiplicative subset of $R$. Then $S^{-1}R$ is flat over $R$.
\item A module $M$ is flat over $R$ iff $M_{\gop}$ is flat over $R_{\gop}$ for every prime ideal $\gop$ of $R$.
\item Let $R$ be a principle ideal domain. Then, $M$ in $R-\Mod$ is flat over $R$ iff it is torsion free.
\end{itemize} 
\end{proposition}
\begin{proof}
\tcg{type it}
\end{proof}


\begin{counterexample}
Let $R$ be a n integral domain, if $M \in R-\Mod$ has a torsion, over $R$, then $M$ is not flat, over $R$.
\end{counterexample}
\begin{proof}[\tcb{incomplete proof}]
Let $M \in R-\Mod$ has a torsion $m_0\in M$, over $R$. Let $r\in R$ be the regular element annihilating $m$. Then we have the embedding monomorphism $\xymatrix{0\ar[r]& R\ar[r]^i & R_r}$, where $R$ and $R_r$ are considered in $R-\Mod$. Then we have the sequence $\xymatrix{0\ar[r]& M\otimes_R R\ar[r]^{M\otimes_R i} & M\otimes_R  R_r}$. Notice that $m\otimes 1 \neq 0 \in M \otimes_R R\cong M$, whereas ${M\otimes_R i}(m\otimes 1)=m\otimes \frac{1}{1}=r\cdot m\otimes \frac{1}{r}=0\otimes \frac{1}{r}=0 \in M\otimes_R  R_r$. Hence, ${M\otimes_R i}$ is not injective.\\
For example, consider $R=\ZZ$, and $M=\ZZ\diagup{2\ZZ}$.
\end{proof}
\tcb{Use having $R$ an I.D. to show that there exist such $r\in R$, such that non of the $r$'s, that annihilate some e$m$,are invertible.}
\begin{lemma}[Snake lemma]

Let $F$ be a flat module, over $R$, and let $\xymatrix{0\ar[r]&N\ar[r]^f & M \ar[r]^g & F\ar[r]&0}$ be a short exact sequence. Then, for every $E\in R-\Mod$, the sequence\\
$\xymatrix{0\ar[r]&E\otimes_R N\ar[r]^{E\otimes_R f} & E\otimes_R M \ar[r]^{E\otimes_R g} & E\otimes_R F\ar[r]&0}$\\
is also exact.
\end{lemma}

\begin{proof}


\tcb{type it P 615}
\end{proof}
\begin{proposition}
Let $\xymatrix{0\ar[r]&F'\ar[r]^f & F \ar[r]^g & F''\ar[r]&0}$ be a short exact sequence in $R-\Mod$, and let $F''$ flat. Then, $F$ is flat, over $R$, iff $F'$ is flat, over $R$.
\end{proposition}
\begin{proof}
\tcb{type it P 616}.
\end{proof}
\black
\section{Field Extensions}
In this section we review the basic properties of field extension used in this notes. Here, we mainly follow \cite[Ch V]{Lan02}.
\begin{definition}
\noindent \textup{Let $K, L$ be fields, such that $K\subset L$, then we say that $L$ is a field extension of $K$, and we denote this field extension by $L/K$. Then, $L$ is a $K\!-\!$vector spaces, we denote its dimension by $[L:K]$, and call it the degree of the extension. If $L$ is a finite dimensional $K\!-\!$vector spaces, we say it is a finite field extension, otherwise we say it is an infinite filed extension.}
\end{definition}
\begin{definition}
\noindent \textup{Let $L/K$ be a field extension, $l\in L$, we say that $l$ is algebraic over $K$ if there exists a non-zero polynomial $m(x)\in K[X]\subset L[X]$ that vanishes at $l$, otherwise we say that $l$ is transcendent over $K$. If all the elements of $L$ are algebraic over $K$, we say that $L$ is an algebraic extension of $K$, otherwise we say that $L$ is a transcendent extension of $K$.}
\end{definition}
\noindent Note that, for $l\in L$ algebraic over $K$, we call the non-zero polynomial in $K[X]$ with lowest degree, that vanishes at $l$, the minimal polynomial of $l$ over $K$ and we denote it by $m_{l,K}(X)$.
:
\[
K[X]/\left(m_{l,K}(X)\right)\cong K[l].
\]
For transcendental extension $L/K$, its transcendental degree is defined to be the maximal cardinality of subsets of algebraically independent elements of $L$ over $K$. And we call a set $S\subset L$ with maximal cardinality of algebraically independent elements of $L$ over $K$, a transcendental base. Then, we can see readily that $L$ is an algebraic extension for $K(S)$. If $L\cong K(S)$, for a transcendental base $S$, we say that $L/K$ is purely transcendental.
\begin{example}
\textup{The extension $\QQ(\sqrt{2})/\QQ$ is an algebraic extension, with a basis $\{1,\sqrt{2}\}$, as a vector space over $\QQ$. Whereas, $K(X)/K$ and $\QQ(\sqrt{2},X)/\QQ$ are transcendental transcendental extension, with a transcendental base $\{X\}$. $K(X)/K$ is a purely transcendental, $\QQ(\sqrt{2},X)/\QQ$ is not, but instead $\QQ(\sqrt{2},X)$ is algebraic over $\QQ(X)$.}
\end{example}
\begin{lemma}
\textup{Every finite field extension is an algebraic extension. \cite[CH V, Prop 1.1]{Lan02}.}
\end{lemma}
\noindent The converse of the above lemma does not hold. For example, the filed of algebraic numbers $\AF$ is an infinite algebraic extension of $Q$.
\begin{lemma}
Let $L/K$ be a field extension, and $l\in L$ algebraic over $K$. Then, $K(l)\cong K[l]$, and $[K(l):K]=deg\ m_{l,K}(X)$. \cite[CH V, Prop 1.4]{Lan02}.
\end{lemma}
\begin{definition}[Embeddings]
\noindent \textup{An injective homomorphism of fields $\sigma:K\rightarrow L$ is called an embedding. Then, $K\cong K^{\sigma}$, and we denote $K^{\sigma}:=\Imm \sigma$. Let $F/K$ be a filed extension, and let $\tau:F\rightarrow L$ be an embedding of fields, the we say that $\tau$ extends over $\sigma$, if the below diagram commutes:}
\[
\xymatrix{
F\ar[rr]^{\tau}&&L\\
&K\ar@{^(->}[lu]^{inc}\ar[ru]_{\sigma}&
}
\]
\end{definition}
Let $\sigma:K\rightarrow L$ be an embedding, and $m(X)\in K[X]$, we write $m^{\sigma}(X)$ for the polynomial in $L[X]$, obtained by applying $\sigma$ to the coefficients of $m(X)$. If $\alpha\in K$ is a root of $m(X)\in K[X]$, $F/K$ and $\tau:F\rightarrow L$ extends over $\sigma$, then $\tau(\alpha)\in L$ is a root for $m^{\sigma}(X)\in L[X]$.
\begin{lemma}
\textup{Let $L/K$ be an algebraic extension, $\sigma:L\rightarrow L$ an embedding over $K$ (over the inclusion), then $\sigma$ is an automorphism.}
\end{lemma}
\begin{proof}
\cite[Ch V, Lem 2.1]{Lan02}.
\end{proof}
\begin{counterexample}
\textup{Consider the embedding $\sigma:K(X)\rightarrow K(X)$ over $K$, induced by $\sigma(X)=X^2$. We can see readily that $\sigma$ is not an automorphism.}
\end{counterexample}
\begin{lemma}
\textup{Let $K$ be a filed, $m(X)\in K[X]$ an irreducible polynomial, of degree $d=\deg\ m(X)\geq 1$. There, exists a field extension $L/K$ in which $m(X)$ has a root.}
\end{lemma}
\begin{proof}
$L\cong K[X]/(m(X))$, and the root of $m(X)\in L[X]$ is $\sigma(X)$, where $\sigma:K[X]\rightarrow K[X]/(m(X))$ is the canonical morphism. \cite[Ch V, Prop 2.3]{Lan02}
\end{proof}
\begin{lemma}
\textup{Let $K$ be a field. Then, there exist an algebraic extension, which is algebraically closed, containing $K$ as a sub-field. Moreover, every algebraic extension of $K$ is embedded in this algebraically closed algebraic extension of $K$ over $K$.}
\end{lemma}
\begin{proof}
\cite[Ch V, Cor 2.6, and Th 2.8]{Lan02}
\end{proof}
\begin{lemma}
\textup{Let $K$, be a field, $L/K$, and $L'/K$  algebraically closed algebraic extension of $K$, then there is an isomorphism $\tau:L\rightarrow L'$ over $K$.}
\end{lemma}
\noindent I.e. algebraically closed algebraic extension of $K$ is unique up-to isomorphism.
\begin{definition}
\textup{Let $K$ be a filed, we call the algebraically closed algebraic extension of $K$, the algebraic closure of $K$, and we denote it $\overline{K}$.}
\end{definition}
\begin{example}
\textup{$\FF_5$ is not algebraically closed that $X^2+3$ does not have roots in $\FF_5$, hence it does not factorise linearly in $\FF_5[X]$.}
\end{example}
\noindent Notice that an algebraic closure of an algebraic extension is the same, up-to isomorphism, of an algebraic closure of the original field, for instance $\overline{\QQ(\sqrt{2})}\cong \overline{\QQ}$.
\begin{lemma}
\textup{Let $K$ be a field, $l\in \overline{K}$. Then, all the roots of $m_{l,K}(X)$ have the same have the same minimal polynomial over $K$, namely $m_{l,K}(X)$.}
\end{lemma}
\begin{definition}[Splitting fields]
\textup{Let $K$ be a field, $m(X)\in K[X]$, $d=deg \ m(x)\geq 1$, we call a filed extension $L/K$ a splitting filed of $m(X)$ over $K$ if $m(X)\in K[X]\subset L[X]$ splits into linear factors:
\[
m(x)=\displaystyle \prod_{i=1}^{d}(X-l_i),\ l_i \in L,
\]
such that $L=K(l_1,l_2,...,l_d)$.}
\end{definition}
\begin{example}
\textup{Consider the field of rational numbers $\QQ$, and $m(X)=X^3-2\in \QQ[X]$. We notice that $\QQ(\sqrt[3]{2})$ contains a root of $m(X)$, namely $\sqrt[3]{2}$, but it does not split into linear factors over $\QQ(\sqrt[3]{2})$, hence it is not a splitting field of $m(X)$. However, $\QQ(\sqrt[3]{2},\zeta_3)$ is a splitting field of $m(X)$ that:
\[
X^3-2=(X-\sqrt[3]{2})(X-\sqrt[3]{2}\zeta_3)(X-\sqrt[3]{2}\zeta^2_3)\ \in \QQ(\sqrt[3]{2},\zeta_3),
\]
and $\QQ(\sqrt[3]{2},\zeta_3)=\QQ(\sqrt[3]{2},\sqrt[3]{2}\zeta_3,\sqrt[3]{2}\zeta^2_3)$.}
\end{example}
\begin{lemma}
\textup{Splitting fields are unique up-to-isomorphism.}
\end{lemma}
\begin{proof}
\cite[Ch V, Th 3.1]{Lan02}.
\end{proof}
\begin{definition}
\textup{Let $K$ be a field, $M_I=\{m_i(X)\}_{i\in I}$ a family of polynomials with coefficient in $K$, we call a filed extension $L/K$, a splitting filed of the family $M_I$ over $K$ if every $m_i(X)\in K[X]\subset L[X]$ splits into linear factors and that $L$ is generated by $K$ with the adjunction of all the roots of $m_i(X), i\in I$.}
\end{definition}
\noindent Notice that, when $I$ is finite, a splitting field of the family $M_I$ is a splitting field for the polynomial $\displaystyle\prod_{i\in I}m_i(X)$.\\

\noindent Note that the algebraic closure of $K$ contains splitting fields for all the non-constant polynomial with coefficient in $K$. Actually, it is a splitting field of the family of non-constant polynomial with coefficient in $K$.
\begin{example}
\textup{We saw that the polynomial $X^2+3$ does not have roots in $\FF_5$, actually it is irreducible over $\FF_5$. Its splitting field, over $\FF_5$, is $\FF_5[X]/(X^2+3)\cong\FF(\sqrt{2})$.}
\end{example}
\begin{lemma}[Normal Extension]\label{NormalExtension}
\textup{Let $L/K$ be an algebraic extension, contained in an algebraic closure $\overline{K}$. Then the following conditions are equivalent:
\begin{itemize}
\item Every embedding $\tau:L\rightarrow \overline{K}$ satisfy $L^{\tau}=L$.
\item $L$ is a splitting field for a family $\{m_i(X)\in K[X]\}_{i\in I}$.
\item Every irreducible polynomial in $K[X]$ that has a root in $K$, splits into linear factors in $L[X]$.
\end{itemize} }
\end{lemma}
\begin{proof}
\cite[Ch V, Th 3.3]{Lan02}
\end{proof}
\begin{example}
\textup{Consider the extension $\QQ(\sqrt[3]{2})/\QQ$ which is a sub-filed of $\overline{\QQ}$, we notice that:
\begin{itemize}
\item The polynomial $X^3-2\in \QQ[X]$ has a root in $\QQ(\sqrt[3]{2})$, but it does not split into linear factors in $\QQ(\sqrt[3]{2})[X]$.
\item We have the embedding $\tau:\QQ(\sqrt[3]{2})\rightarrow \overline{\QQ}$ over $\QQ$, that sends $\sqrt[3]{2}$ to $\tau(\sqrt[3]{2})=\sqrt[3]{2}\zeta_3$. Then, $\left(\QQ(\sqrt[3]{2})\right)^{\tau}=\QQ(\sqrt[3]{2}\zeta_3)\neq \QQ(\sqrt[3]{2})$.
\end{itemize} }
\end{example}
\begin{definition}
\textup{Let $L/K$ be a field extension, we say that $F/L$ is a normal closure of $L$ if $F/K$ is normal, and $F$ is the minimal such extension of $L$ for which $F/K$ is normal.}
\end{definition}
\begin{question}
\tcr{Does the normal closure always exists?}
\end{question}
\begin{example}
\textup{The extension $\QQ(\sqrt{\alpha})/\QQ$ is normal, for $\alpha \in \QQ$.\\
Also, $\QQ(\sqrt[p]{2},\zeta_p)/\QQ$ is a normal. Actually, $\QQ(\sqrt[p]{2},\zeta_p)$ is the normal closure of $\QQ(\sqrt[p]{2})$.
}
\end{example}
\begin{definition}
\textup{Let $L/K$ be an algebraic extension, contained in an algebraic closure $\overline{K}$. We say that $L/K$ is normal if it satisfies any of the conditions of \ref{NormalExtension}.}
\end{definition}
\noindent Notice that if $L/K$, and $F/L$ are normal, then $F/K$ is not necessary normal.
\begin{example}
\textup{Let $\alpha=\sqrt{2}\in \CC$, then $\QQ(\alpha)/\QQ$, and $\QQ(\sqrt{\alpha})/\QQ(\alpha)$ are normal, but $\QQ(\sqrt{\alpha})/\QQ$ is not normal.}
\end{example}
Note that not all normal extension are splitting field for single polynomial, for example $\overline{\QQ}$ is not a splitting field for any $m(X)\in \QQ[X]$, but rather the splitting field for all non-constant polynomials with coefficient in $\QQ$.
\begin{definition}[Separable Extension]
\textup{Normal}
\end{definition}







Seprable closure

Example of finite fields

the field and its extension both have the same characteristic 

Separable extension
Galois extension
perfect field
integral extension
embedding
text up!!!!!!
lifting of fields